<template>
  <div class="all">
    <div class="add-nav">
      <ul>
        <li class="list">收益分成设置</li>
      </ul>

      <div class="Param">
        <table width="100%">
          <tbody>
            <tr>
              <th>主播个人</th>
              <td>
                <input type="text" value="proP.anchor" size="5" v-model="proP.anchor">%
               <font color="gray">请输入主播分成百分比</font>
              </td>
            </tr>
            <tr>
              <th>工会主播房间</th>
              <td>
                <input type="text" value="proP.anchor" size="5" v-model="proP.anchorAgent">%
               <font color="gray">请输入工会主播房间分成百分比</font>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
      <button @click="Submit()">确定</button>
      </div>
      </div>
</template>

<script>
export default{
  data(){
    return{
      proP:{
        anchor:'',
        anchorAgent:'',
        chargeAgent:'',
      }
    }
  },
  methods:{  
    Submit(){
    this.Postdata('admin/config/share/set')
    },
    Postdata(e){
      var _this=this
      this.$axios({
        method: "POST",
            url: '/api/'+e,
            data: {
                  adminName:_this.$cookies.get('adminName'),
                  token:_this.$cookies.get('token'),
                  anchor:_this.proP.anchor,
                  anchorAgent:_this.proP.anchorAgent,
                  chargeAgent:_this.proP.chargeAgent
        },
        headers: {
                'Content-Type': 'application/json'
                 }
      }).then(function(response){
        // console.log(response)
        if(response.data.code==0){
          if(response.data.data){
            _this.proP=response.data.data
          }else{
       _this.$alert('修改成功', '提示', {
          confirmButtonText: '确定',
          callback: action => {

          }
        });
          }
        }


         console.log(response)
       })
       .catch(function(error){
         console.log(error)
       })

    }
  },
  mounted(){
    this.Postdata('admin/config/share/get')
  }
  }
</script>

<style lang="scss" scoped src = "../../css/system.css">

</style>
